import { App } from "../../../../src/App";
import { GameModule, LandlordEvents } from "../Game/GameModule";

const {ccclass, property} = cc._decorator;

@ccclass
export default class Rule extends cc.Component {
    @property(cc.RichText)
    lblRule: cc.RichText = null;
    @property(cc.RichText)
    lblTips: cc.RichText = null;

    start(){
        const str = App.getText(GameModule.isSingle ?  'landlord.watch_viedo0' : 'landlord.watch_viedo1');
        const rewards = App.getCfg('reward'); 
        this.lblTips.string = App.Util.format(str,rewards[GameModule.isSingle?0:1]);
    }
    onPlayClicket(){
        if (GameModule.isPlaying){
            return ;
        }
        App.Event.emit(LandlordEvents.EC_WATCH_VIDEO);
    }

    // update (dt) {}
}
